Nodes of a network that employs an interior gateway protocol (IGP) may use a link state routing protocol, such as Intermediate System-to-Intermediate System (IS-IS) or Open Shortest Path First (OSPF), to forward data packets, such as Internet Protocol (IP) packets. The nodes may also employ segment-routing (SR)-multiprotocol label switching (MPLS) (SR-MPLS) to forward MPLS packets. The nodes determine shortest cost paths in the network for forwarding the IP packets. Using a conventional technique to determine the shortest cost paths, the nodes initially discover a link state topology of the network, and then apply a conventional shortest path algorithm, such as the Dijkstra's computation, to the link state topology. This approach does not take into account the fact that some of the nodes may not support MPLS, which results in shortest paths that do not support MPLS end-to-end dataplane continuity, and thus that drop MPLS packets. To take into account MPLS dataplane continuity, another conventional shortest path algorithm uses multiple types of network topologies, including both the link state topology and an MPLS topology, which adds substantial complexity.